import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:toolbox/models/TranslateModel.dart';

class TranslateState {
  String getBuilderIdLanguagesTip = 'getBuilderIdLanguagesTip';

  TextEditingController controller = TextEditingController();
  FocusNode focusNode = FocusNode();
  final RxString result = ''.obs;
  final Rx<Languages> from = Languages.auto.obs;
  final Rx<Languages> to = Languages.auto.obs;
  final TextEditingController fromController = TextEditingController();
  final TextEditingController toController = TextEditingController();
  final Rx<String> autoTo = ''.obs;
  final Rx<String> autoFrom = ''.obs;
  RxList<TranslateModel> history = <TranslateModel>[].obs;
  bool isSelecting = false;

  bool get showLanguagesTip {
    if (autoFrom.value.isEmpty || autoTo.value.isEmpty) return false;
    return from.value == Languages.auto || to.value == Languages.auto;
  }

  TranslateState();
}
